package com.house.mapper;

import com.house.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface MessageMapper {
    int insertOne(@Param("userId")int userId, @Param("toUserId")int toUserId, @Param("content")String content, @Param("createDate")Date createDate);

    List<Message> findAllToUserId(@Param("toUserId")int toUserId);
    List<Message> findByToUserIdAndUserId(@Param("UserId")int userId,@Param("toUserId")int toUserId);
    int deleteById(@Param("id")int id);
}
